<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- case 小例子或者选项的意思 -->
    <script>
        var num = 5;
        switch (num) {
            case 1: console.log('这是1')
                break;
            case 2: alert('这是2')
                break;
            case 5: alert('这是5')
                break;
            case 8: console.log('这是8')
                break;
            case 7: console.log('这是7')
                break;
            default:
        }

    </script>
</head>

<body>

</body>

</html>